<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div class="bw1">
        <div class="bw2">
            <span class="bw3">
                111
            </span>
        </div>
    </div>


    <script>
        const spanObj = document.querySelector("span")
        console.log(spanObj)
        console.log(spanObj.parentNode); //<div class="bw2">

        const div2Obj = document.querySelector(".bw2")
        console.log(div2Obj.parentNode) //<div class="bw1">

        const div1Obj = document.querySelector(".bw1")
        console.log(div1Obj.parentNode) //body

        const htmlObj = document.querySelector("html")
        console.log(htmlObj.parentNode) //document
        console.log(htmlObj.parentElement) //null

         console.log(spanObj.parentNode.parentNode.parentNode);     //body

    </script>

</body>

</html>